from selenium.webdriver.common.by import By

from pages.base_page import Page


class MaximumOnPage(Page):
    ele_maximumon_title = (By.ID, u'maximumOn-title')
    ele_maximumon_switch_logs = (By.XPATH, u"//p[text()='MaximumOn Server Switch Logs']")

    ele_maximumon_feature_introduction = (By.XPATH, u"//h3[text()='Feature Introduction']")

    def __init__(self, driver, url, site_id):
        Page.__init__(self, driver, url)
        self.site_id = site_id
        self.url = url

    def maximumon_eles_check_when_has_maximumon_feature(self):
        self.find_element(*self.ele_maximumon_title).is_enabled()
        self.find_element(*self.ele_maximumon_switch_logs).is_enabled()

    def maximumon_eles_check_when_no_maximumon_feature(self):
        self.find_element(*self.ele_maximumon_title).is_enabled()
        self.find_element(*self.ele_maximumon_feature_introduction).is_enabled()
